<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib prefix="limits" uri="/WEB-INF/tld/limits.tld"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>操作记录管理</title>
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/WdatePicker/skin/WdatePicker.css">


<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>



<script type="text/javascript">
		var queryParams;
		function EasyuiDatagrid() {
			$("#easyui-datagrid").datagrid({
				url: '../../statistics/selectContentLedgerList.do',
				nowrap: true,
				striped: true,
				border: false,
				fit: true,
				rownumbers:true,
				queryParams: getGueryParams(),
				columns: [
				          [
							{field:'id',checkbox:true},
							{field:'f_ccl_user',title:'操作用户名称',align:'center',width:150},
							{field:'f_ccl_contentName',title:'操作节目名称',align:'center',width:300},
							{field:'f_ccl_ip',title:'ip',align:'center',width:80},
							{field:'f_ccl_mac',title:'mac',align:'center',width:80},
							{field:'f_ccl_type',title:'操作类型',align:'center',width:80,
								formatter:function(value,row,index) {
									var str = "未知";
									if(value==1){
										str = "新增";
									}else if(value==2){
										str = "修改";
									}else if(value==3){
										str = "市审核";
									}else if(value==4){
										str = "省审核";
									}else if(value==5){
										str = "牌照审核";
									}else if(value==6){
										str = "删除";
									}
									return str;
								}	
							},
							{field:'f_ccl_cdate',title:'创建时间',align:'center',width:150,
								formatter:function(value,row,index) {
									var str = "";
									if(value!=null)
										str = value.substring(0,19);
									return str;
								}	
							}
						]
				       ],
				singleSelect:false,
				pagination:true,
				pageList:[10,20,30,40,50],
				pageSize:10,
				toolbar: '#toolbar',
				
				onExpandRow: function(index,row){
				
				},
				onSelect: function(rowIndex,rowData) {
					
				},
				onUnselect: function(rowIndex,rowData) {
					
				},
				onCheckAll: function(rowIndex,rowData) {
					
				},
				onUncheckAll: function(rowIndex,rowData) {
				
				},
				onLoadSuccess: function(data) {
					if(data.total==-1) {
						$.messager.defaults={ok:"确定",cancel:"取消"};
						$.messager.confirm('提示', '用户尚未登录,请登录', function(r){
						if (r){
						    window.parent.location.href='/login.do';
						    return false;
						}});
					}
				}
			});
		}
	
		function getGueryParams(){
			return {
				f_ccl_type:$("#f_ccl_type").val(),
				f_ccl_contentName:$("#f_ccl_contentName").val(),
				f_ccl_user:$("#f_ccl_user").val()
			};
		}
		
		$(function(){
			new EasyuiDatagrid();
			gotoSearch = function(){
				$("#easyui-datagrid").datagrid('reload',getGueryParams());
			};
			
		});
		
		function SubgridTabOnSelect(title,index){
			 setTimeout(function(){
				$("#easyui-datagrid").datagrid('fixDetailRowHeight',index);
			},300);
			setTimeout(function(){
				$("#easyui-datagrid").datagrid('fixDetailRowHeight',index);
			},3000);
	    } 
		
		function load(){
			$(".datagrid-row-expander datagrid-row-expand").attr("display","none"); 
		}
		
		
		function onpress(){
			var event=arguments.callee.caller.arguments[0]||window.event;//消除浏览器差异
	   		  	if (event.keyCode == 13){  
	      			gotoSearch($('#easyui-treegrid'));
	    		}
		}
		function exportExcel(){
			var f_ccl_type="";
			var f_ccl_contentName="";
			var f_ccl_user="";
			 //page页码
            var page = $("#easyui-datagrid").datagrid('options').pageNumber;  
            //rows每页记录条数  
            var rows = $("#easyui-datagrid").datagrid('options').pageSize;  
			if($("#f_ccl_type").val()!=null&&$("#f_ccl_type").val()!=""){
				f_ccl_type=$("#f_ccl_type").val();
			}
			if($("#f_ccl_contentName").val()!=null&&$("#f_ccl_contentName").val()!=""){
				f_ccl_contentName=$("#f_ccl_contentName").val();
			}
			if($("#f_ccl_user").val()!=null&&$("#f_ccl_user").val()!=""){
				f_ccl_user=$("#f_ccl_user").val();
			}
			var url="../../statistics/contentLedger_excel_list.do?f_ccl_type="+f_ccl_type+"&f_ccl_contentName="+f_ccl_contentName+"&f_ccl_user="+f_ccl_user+"&page="+page+"&rows="+rows;
	        window.open(url);
		}
	
	</script>
</head>
<body onload="load();" style="width: 100%;">
	<input type="hidden" id="sessionId" value="${pageContext.session.id}" />
	<table id="easyui-datagrid" title="操作记录列表"></table>
	<div id="toolbar" class="easyui_datagrid_toolbar" style="">
		<div class="easyuiSearch">
			<form onsubmit="return false;" method="post">
				<table cellspacing="0" cellpadding="0" width="90%">
					<tr>
						<td align="left" width="7%">操作账户名称：</td>
						<td align="left" width="15%"><input name="f_ccl_user" id="f_ccl_user" style="width: 150px;" onkeydown="onpress();" /></td>
						
						<td align="left" width="7%">操作节目名称：</td>
						<td align="left" width="15%"><input name="f_ccl_contentName" id="f_ccl_contentName" style="width: 150px;" onkeydown="onpress();" /></td>
						<td align="left" width="7%">操作类型：</td>
						<td align="left" width="15%">
							<select id="f_ccl_type" name="f_ccl_type">
									<option value="0">请选择</option>
									<option value="1">新增</option>
									<option value="2">修改</option>
									<option value="3">市审核</option>
									<option value="4">省审核</option>
									<option value="5">牌照审核</option>
									<option value="6">删除</option>
							</select>
						</td>
						
						
						<td align="left" width="15%">
							<limits:uiAuth url="selectContentLedgerList.do">
								<a href="javascript:void(0);" class="easyui-linkbutton"
									data-options="iconCls:'icon-search', plain:true"
									onclick="gotoSearch($('#easyui-datagrid'))">查询</a>
							</limits:uiAuth>
						</td>
						<td align="left">
							<limits:uiAuth url="excel_list.do">
								<a href="javascript:void(0);" class="easyui-linkbutton"
									data-options="iconCls:'icon-save', plain:true"
									onclick="javascript:exportExcel()">导出Excle</a>
							</limits:uiAuth>
						</td>	
					</tr>
					<tr>
						
						
						
					</tr>
				</table>
			</form>
		</div>
		<div style="margin-bottom: 5px">
			<!-- <a href="javascript:void(0)" class="easyui-linkbutton" onclick="delete();" iconCls="icon-cut" plain="true">删除</a>  -->
		</div>
	</div>
<script type="text/javascript">
</script>
	
	
	
</body>
</html>